﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ChicagoDealsN;
using System.Data.SqlClient;
using System.Data;

namespace ChicagoDealsN
{
    public class BizDeals
    {
        public bool BLCreateDeal(string title, string imgPath, string companyName, string dealDescription, float orgPrice, float dealPrice, string startDate, string endDate, int qty, int userId)
        {
            Deals d = new Deals();            
            bool b=d.DLCreateDeal(title,imgPath,companyName,dealDescription,orgPrice,dealPrice,startDate,endDate,qty,userId);
            return b;
        }

        public DataTable BLGetDealById(int id)
        {
            Deals dd = new Deals();            
            return dd.DLGetRowById(id).Tables["ITEMBYID"];
        }

        public DataTable BLGetDealByUserId(int id)
        {
            Deals dd = new Deals();
            return dd.DLGetDealById(id).Tables["ITEMBYID"];
        }


        public DataTable BLGetAllDeals()
        {
            Deals dga = new Deals();
            return dga.DLGetAllDeals().Tables["AllDealTable"];
        }
        public Boolean BLUpdateDeal(int id, string title, string companyName, string imgPath, string dealDescription, float orgPrice, float dealPrice, String startDate, string endDate, int qty)
        {
            Deals dbu = new Deals();
            return dbu.DLUpdateDeal(id,title,companyName, imgPath, dealDescription, orgPrice, dealPrice, startDate, endDate, qty );

        }
          
          
        public bool BLDeleteDeal(int id)
        {
            Deals dga = new Deals();
            return dga.DLDeleteDeal(id);
        }
    }
}